<style type="text/css">
#winBodyContainer{
	overflow-y: scroll;
	height: 500px;
}
.edit-remark{
	display: none;
}
</style>
<div style="width:500px;">
	<div class="form_data">
		<div class="mod_name">
			<span class="name">用户信息</span>
		</div>
		<div class="mod_data">
			<div class="input_data" style="text-align:center;width:100%;">
				<img src="{:D('File')->get_path($user_info['head_id'], '120', '120')}" width="120" height="120" alt="">
			</div>
		</div>
		<div class="mod_data">
			<div class="name">姓名</div>
			<div class="input_data">
				{$user_info['realname']}
			</div>
		</div>
		<div class="mod_data">
			<div class="name">昵称</div>
			<div class="input_data">
				{$user_info['nickname']}
			</div>
		</div>
		<div class="mod_data">
			<div class="name">手机号</div>
			<div class="input_data">
				{$user_info['mobile']}
			</div>
		</div>
		<div class="mod_data">
			<div class="name">性别</div>
			<div class="input_data">
				<eq name="user_info.sex" value="1">男</eq>
				<eq name="user_info.sex" value="2">女</eq>
				<eq name="user_info.sex" value="0">未设置</eq>
			</div>
		</div>

		<div class="mod_data">
			<div class="name">状态</div>
			<div class="input_data">
				<eq name="user_info.status" value="1">启用</eq>
				<eq name="user_info.status" value="0">禁用</eq>
			</div>
		</div>

		<div class="mod_name">
			<span class="name">提现信息</span>
		</div>
		
		<div class="mod_data">
			<div class="name">银行名称</div>
			<div class="input_data">
				{$bank_carid['bank_name']}
			</div>
		</div>
		<div class="mod_data">
			<div class="name">所属城市</div>
			<div class="input_data">
				{$bank_carid['city_name']}
			</div>
		</div>
		<div class="mod_data">
			<div class="name">开户行名称</div>
			<div class="input_data">
				{$bank_carid['open_bank_name']}
			</div>
		</div>
		<div class="mod_data">
			<div class="name">银行卡号</div>
			<div class="input_data">
				{$bank_carid['card_no']}
			</div>
		</div>
		<div class="mod_data">
			<div class="name">账户名</div>
			<div class="input_data">
				{$bank_carid['account_name']}
			</div>
		</div>
		<div class="mod_data">
			<div class="name">申请时间</div>
			<div class="input_data">
				{:date('Y-m-d H:i:s',$info['create_time'])}
			</div>
		</div>
		<div class="mod_data">
			<div class="name">账户余额</div>
			<div class="input_data">
				<span class="price">{$info['usable_money']}</span>
			</div>
		</div>
		<div class="mod_data">
			<div class="name">提现金额</div>
			<div class="input_data">
				<span class="price">{$info['money']}</span>
			</div>
		</div>

		<neq name="info.status" value="1">

		<div class="mod_name">
			<span class="name">审核情况</span>
		</div>

		<div class="mod_data">
			<div class="name">审核人</div>
			<div class="input_data">
				{$info['admin_name']}
			</div>
		</div>

		<div class="mod_data">
			<div class="name">审核状态</div>
			<div class="input_data">
				<php>$status_desc = C('take_out_status_desc');</php>
				{$status_desc[$info['status']]}
			</div>
		</div>

		<div class="mod_data">
			<div class="name">审核时间</div>
			<div class="input_data">
				{:date('Y-m-d H:i:s',$info['update_time'])}
			</div>
		</div>

		<div class="mod_data">
			<div class="name">银行单号</div>
			<div class="input_data">
				{$info['trade_no']}
			</div>
		</div>

		<div class="mod_data">
			<div class="name">平台提现银行</div>
			<div class="input_data">
				{:D('Category')->get_name($info['platform_bank_id'])}
			</div>
		</div>

		<div class="mod_data">
			<div class="name">手续费</div>
			<div class="input_data">
				<span class="price">{$info['deal_charge']}</span>
			</div>
		</div>

		<div class="mod_data">
			<div class="name">备注</div>
			<div class="input_data">
				<div class="label-remark">
					<span class="remark">{$info['remark']}</span>
					<span class="btn1 btn-edit-remark">修改备注</span>
				</div>
				<div class="edit-remark">
					<textarea name="remark" style="width:300px;height: 120px;">{$info['remark']}</textarea>
				</div>
				<div class="edit-remark" style="margin-top: 10px;">
					<input type="submit" value="确认修改" class="btn1 submit-remark-edit">
					<input type="button" value="取消" class="btn2 cancel-edit">
				</div>
			</div>
		</div>

		</neq>
		<eq name="info.status" value="1">
		<form action="__SELF__" method="post">
		<div class="mod_name">
			<span class="name">提现操作</span>
		</div>
		
		<notempty name="info.pay_status">
		<div class="mod_data">
			<div class="name">上次付款提示</div>
			<div class="input_data">
				<font color="red">{:D('Category')->get_name($info['platform_bank_id'])}->{$info['pay_status']}</font>
			</div>
		</div>
		</notempty>

		<div class="mod_data">
			<div class="name">状态</div>
			<div class="input_data">
				<select name="status" datatype="*">
					<option value="">请选择状态</option>
					<php>$take_out_status_desc = C('take_out_status_desc');</php>
					<volist name="take_out_status_desc" id="status_name">
					<neq name="key" value="$info['status']">
					<neq name="key" value="4">
					<option value="{$key}">{$status_name}</option>
					</neq>
					</neq>
					</volist>
				</select>
			</div>
		</div>

		<div class="mod_data platform_bank_id">
			<div class="name">平台提现银行</div>
			<div class="input_data">
				<select name="platform_bank_id" datatype="*" nullmsg="请选择">
					<option value="">请选择平台银行</option>
					<php>$platform_bank_list = D('Category')->get_list('platform_bank_list');</php>
					<volist name="platform_bank_list" id="rs">
					<option value="{$rs['id']}">{$rs['title']}({$rs['description']})</option>
					</volist>
				</select>
			</div>
		</div>

		<div class="mod_data trade_no">
			<div class="name">银行单号</div>
			<div class="input_data">
				<input type="text" name="trade_no" value="{$trade_no}" style="width:180px;" datatype="*">
			</div>
		</div>

		<div class="mod_data">
			<div class="name">备注</div>
			<div class="input_data">
				<textarea name="remark" style="width:300px;height: 120px;">{$info['remark']}</textarea>
			</div>
		</div>

		<div class="mod_submit" style="padding-left:0px;text-align:center">
			<input type="hidden" name="admin_id" value="{$_user_id}" />
			<input type="submit" value="确认提交" class="btn1 ajax_submit">
			<input type="button" value="提交到快钱" class="btn2 to-bank" url="{:U('take_out_to_bank', array('take_out_id' => $info['id']))}">
		</div>
		</form>
		</eq>

	</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
	$('.btn-edit-remark').click(function () {
		$('.label-remark').hide();
		$('.edit-remark').show();
		$('.edit-remark textarea').focus();
	});
	$('.cancel-edit').click(function () {
		$('.label-remark').show();
		$('.edit-remark').hide();
	})
	$('select[name="status"]').val("{$info['status'] == 1 ? 2 : $info['status']}");
	$('select[name="platform_bank_id"]').val(158);
	//AJAX修改备注
	$('.submit-remark-edit').click(function () {
		var content = $('.edit-remark textarea').val();
		var url     = '{:U("edit_take_out_remark", array("take_out_id"=>$info["id"]))}';
		var data    = "content=" + content;
		$.ajax({
			url : url,
			data : data,
			type : 'post',
			dataType:'json',
			success : function(json){
				removeLoading();
				if(json.status == 200){
					msgbox(json.info);
					$('.label-remark').show();
					$('.edit-remark').hide();
					$('.label-remark .remark').text(content);
				}else{
					msgbox(json.info,'error');
				}
			}
		});
	});
	//提交到快钱
	$('.to-bank').click(function () {
		loading('正在提交，请稍候...');
		var url = $(this).attr('url');
		$.ajax({
			url : url,
			type : 'post',
			dataType:'json',
			success : function(json){
				removeLoading();
				if(json.status == 200){
					msgbox(json.info);
					$('.take-out-' + {$info['id']} + ' .platform_bank_name').text(json.data.platform_bank_name);
					$('.take-out-' + {$info['id']} + ' .status_desc').text(json.data.status_desc);
					$('.take-out-' + {$info['id']} + ' .update_time_desc').text(json.data.update_time_desc);
					$('.take-out-' + {$info['id']} + ' .opt-info').html('');
					$.winRemove();
				}else{
					msgbox(json.info,'error');
				}
			}
		});
	});
	var form_valid = $("#winBodyContainer form").Validform({
		tiptype:3,
		label:".name",
		showAllError:true
	});
	$('#winBodyContainer select[name="status"]').change(function () {
		var status = $(this).val();
		if(status ==3){
			$('#winBodyContainer input[name="trade_no"]').removeAttr('datatype');
			$('#winBodyContainer select[name="platform_bank_id"]').removeAttr('datatype');
			$('.trade_no').hide();
			$('.platform_bank_id').hide();
			$('.to-bank').hide();
		}else{
			$('#winBodyContainer input[name="trade_no"]').attr('datatype','*');
			$('#winBodyContainer select[name="platform_bank_id"]').attr('datatype','*');
			$('.trade_no').show();
			$('.platform_bank_id').show();
			$('.to-bank').show();
		}
	});
	$("form input.ajax_submit").click(function () {
		//验证表单是否能提交(实时验证会被跳过BUG)
		if(form_valid.check()==false){return false;}
		loading('正在提交，请稍候...');
		var url     = '{:U("win_take_out", array("id"=>$info["id"]))}';
		var data    = $('form').serialize();
		$.ajax({
			url : url,
			data : data,
			type : 'post',
			dataType:'json',
			success : function(json){
				removeLoading();
				if(json.status == 200){
					msgbox(json.info);
					$('.take-out-' + {$info['id']} + ' .platform_bank_name').text(json.data.platform_bank_name);
					$('.take-out-' + {$info['id']} + ' .status_desc').text(json.data.status_desc);
					$('.take-out-' + {$info['id']} + ' .update_time_desc').text(json.data.update_time_desc);
					$('.take-out-' + {$info['id']} + ' .admin_name').text(json.data.admin_name);
					$('.take-out-' + {$info['id']} + ' .opt-info').html('<a href="{:U('win_take_out',array('id'=>$info['id']))}" class="win btn1">查看</a>');
					$.winRemove();
				}else{
					msgbox(json.info,'error');
				}
			}
		});
		return false;
	});
});
</script>

